package com.controller;


import com.pojo.SecondMenu;
import com.service.SecondMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping; 
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

@Controller
public class SecondMenuController {
    @Autowired
    private SecondMenuService secondMenuService;
    @GetMapping("/secondmenu")
    public String secondMenu(Model model){
        List<SecondMenu> list=secondMenuService.getAllSecondMenu();
        model.addAttribute("list",list);
        return "secondMenu";
    }
    @RequestMapping(value="/secondmenu/{id}",method= RequestMethod.GET)
    public String toTaozhuang(@PathVariable("id") Integer id, Model model){
        if (id==1){
            return "feerecord";
        }else if(id==2){
            return "register";
        }else if(id==4) {
        	return "changeTaoCan";//加 跳转更换套餐页面
        }
        return null;
    }
   
}
